Skip to content

Conversation

@americodls
Copy link

This PR adds RSpec's example.id as a span attribute to provide unique identification for each test example.

The existing rspec.example.location attribute cannot uniquely identify dynamically generated examples (e.g., examples created within loops or using data tables) because multiple examples share the same source file location. RSpec's example.id provides a stable, unique identifier across test runs even for these dynamic cases.

Example format: ./spec/foo_spec.rb[1:2:3]

This enables better correlation and tracking of individual test executions in observability platforms.


Upstream PR: open-telemetry#1713

Record RSpec's example.id as a span attribute to provide unique identification for each test example. This is particularly valuable when examples are created dynamically (e.g., within loops), where multiple examples share the same file location but have distinct IDs.
@americodls americodls merged commit 81bcf49 into main Oct 2, 2025
63 checks passed
@americodls americodls deleted the ad/add-example-id-attribute-fork branch October 2, 2025 14:11
americodls added a commit that referenced this pull request Oct 8, 2025
This PR adds RSpec's `example.id` as a span attribute to provide unique
identification for each test example.

The existing `rspec.example.location` attribute cannot uniquely identify
dynamically generated examples (e.g., examples created within loops or
using data tables) because multiple examples share the same source file
location. RSpec's `example.id` provides a stable, unique identifier
across test runs even for these dynamic cases.

Example format: `./spec/foo_spec.rb[1:2:3]`

This enables better correlation and tracking of individual test
executions in observability platforms.

---

Upstream PR:
open-telemetry#1713
americodls added a commit that referenced this pull request Oct 12, 2025
This PR adds RSpec's `example.id` as a span attribute to provide unique
identification for each test example.

The existing `rspec.example.location` attribute cannot uniquely identify
dynamically generated examples (e.g., examples created within loops or
using data tables) because multiple examples share the same source file
location. RSpec's `example.id` provides a stable, unique identifier
across test runs even for these dynamic cases.

Example format: `./spec/foo_spec.rb[1:2:3]`

This enables better correlation and tracking of individual test
executions in observability platforms.

---

Upstream PR:
open-telemetry#1713
americodls added a commit that referenced this pull request Oct 14, 2025
This PR adds RSpec's `example.id` as a span attribute to provide unique
identification for each test example.

The existing `rspec.example.location` attribute cannot uniquely identify
dynamically generated examples (e.g., examples created within loops or
using data tables) because multiple examples share the same source file
location. RSpec's `example.id` provides a stable, unique identifier
across test runs even for these dynamic cases.

Example format: `./spec/foo_spec.rb[1:2:3]`

This enables better correlation and tracking of individual test
executions in observability platforms.

---

Upstream PR:
open-telemetry#1713
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants